import request from '@/utils/request'
// 获取新闻列表
export const articleList = (params)=>{
    
    return request({
        url:'/v1_0/articles',
        params
    })
}

// 获取文章详情

export const articleInfo = (id)=>{
    
    return request({
        // url:`/v1_0/articles/${id}`,
        url: `/v1_0/articles/${id}`,
        
    })
}


// 对文章进行点赞
export const articlePraise = (data)=>{
    
    return request({
        url: "/v1_0/article/likings",
        method:'post',
        data
    })
}

// 取消对文章进行点赞
export const unArticlePraise = (id)=>{
    
    return request({
        url: `/v1_0/article/likings/` + id,
        method:'delete',
    })
}

// 对文章不喜欢
export const unlike = (data)=>{
    
    return request({
        url: "/v1_0/article/dislikes",
        method:'post',
        data
    })
}

// 取消对文章不喜欢
export const cancelUnlike = (id)=>{
    
    return request({
        url: "/v1_0/article/dislikes/" + id,
        method:'delete',
        
    })
}




